Skip to content

Document expanded scoped API key permissions - #751

Merged
sjmiller609 merged 25 commits into
mainfrom
hypeship/expand-scoped-key-docs
Nov 25, 2026
Merged

sjmiller609 merged 25 commits into
mainfrom
hypeship/expand-scoped-key-docs

Conversation

@sjmiller609

@sjmiller609 sjmiller609 commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Expand the scoping reference to cover the public API permissions and add paired TypeScript and Python policies for common workloads. Document which actions must be granted together and when callers need access to resources referenced by another object.

  • Distinguish renaming a key (api_keys:write) from replacing its policy and IP conditions in place (api_keys:set_policy). Cover delegation, expiry, rotation and revocation without changing the workload identity guidance.
  • Correct native OAuth consent: a person chooses permissions and one project or all projects. Native tokens cannot manage API keys; service accounts have additional restrictions.
  • Explain what scoped deployers and invokers must grant. A deployment stores its runtime policy, defaults to callback-only access for scoped deployers, and issues a fresh 65-minute key per invocation independent of the deploying key’s lifetime. Existing shared-key deployments are unchanged.

Publishing

Merge these docs only after kernel/kernel#5724 and kernel/kernel#5749 (action wildcards) have deployed to production. They describe scoped deployments without a rollout flag; unrestricted callers that omit runtime_policy still use shared keys.

Experimental validation

Ran in production with short-lived, policy-scoped project keys; each check used narrower keys to confirm omitted actions return 403.

  • Apps: deployed with and without runtime_policy; two invocations read their own invocation with the injected credential. Invoking without covering the runtime policy returned 403.
  • Keys: project selection by ID and name, child-key issuance and expiry limits, rename vs policy replacement, invalid policies (400), and deletion.
  • Resources: browsers, profiles, pools, proxies, extensions, vaults, credentials, auth connections, tasks/reports, and config registry behaved as documented.
  • Reference: all eight policy examples were accepted with their stated allow/deny behavior; 23 endpoint-to-action mappings and 11 list filters matched.
  • Not exercised: action wildcards (API change not yet deployed), external telemetry delivery, real logins, wallet operations, and organization administration.
  • CLI flags checked against the released client. Mintlify validation and broken-link checks passed.

Validation

  • All 84 public action names in the reference match the API registry after excluding internal Search actions.
  • Executed all eight TypeScript/Python policy example pairs and compared the resulting documents; each pair matched.
  • mint validate and mint broken-links passed at 734927d.

Note

Low Risk
Documentation-only changes with no runtime code; risk is limited to doc accuracy and publishing timing relative to dependent API deploys noted in the PR.

Overview
This PR expands Kernel docs for scoped API keys: a new API Key Policy Examples page, a greatly enlarged Scoping Permissions reference (selectors, action wildcards, per-resource actions, and multi-action prerequisites), and major rewrites of API Keys, deploy, telemetry export, projects, authentication, and CLI references.

API keys and apps: Documentation now separates org/project boundary from optional policies, covers delegation (api_keys:create, issue_beyond_expiry, set_policy, rotation rules), and replaces the old deployment-key model with app runtime policy (runtime_policy on POST /deployments, default callback-only access for scoped deployers, per-invocation injected keys, and shared-key legacy behavior). Deploy docs call out CLI limits when using scoped keys.

Cross-cutting updates: Telemetry export and projects pages document org vs project credentials, policy actions for destinations, and X-Kernel-Project (name or ID). CLI api-keys commands document --policy, filters, and policy updates; docs.json adds the examples page to the nav.

Reviewed by Cursor Bugbot for commit 5dcfaba. Bugbot is set up for automated code reviews on this repo. Configure here.

@mintlify

mintlify Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
Kernel 🟢 Ready View Preview Nov 25, 2026, 5:40 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

Comment thread apps/deploy.mdx Resolved
Comment thread apps/deploy.mdx Resolved
Comment thread apps/deploy.mdx Resolved
Comment thread apps/deploy.mdx Resolved
Comment thread browsers/telemetry/export.mdx Resolved
Comment thread info/api-keys.mdx Resolved

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread info/api-keys.mdx Resolved

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 37f82be. Configure here.

Comment thread info/api-keys.mdx Resolved

@rgarcia rgarcia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approving — the content checks out against the API: all 84 action names match action.go, the TS/Python pairs grant identical statements, and the CLI flags match v0.54.0. most of what's below is about tightening and de-duplicating. #5749 merged today, so this is ready to publish once it's deployed.

Questions / correctness

  • info/api-keys.mdx:319 — the default runtime grant is project-wide invocations:write, so any app's run can overwrite or attach browsers to any invocation in the project. consider telling readers to put mutually untrusted apps in separate projects (and maybe a kernel/kernel follow-up to scope the grant to the deployment's own invocations)
  • info/api-key-policy-examples.mdx:99 — the API rejects an OTLP destination when telemetry capture is off. consider showing the full telemetry object or noting that capture must be on, so a copy-paste doesn't 400
  • apps/deploy.mdx:50 — kernel deploy with a scoped key yields a callback-only app whose browser calls 403 at runtime. consider spelling out that outcome and the fix (deploy through the API with runtime_policy, or an unrestricted key)
  • info/projects.mdx:28 — two project headers but no guidance on which to use. consider recommending X-Kernel-Project and noting that sending both returns 400 conflicting_project_headers
  • info/api-key-permissions.mdx:31 — bare {kind}/{id} for project resources resolves against the request's project. consider saying outright to prefer projects/{project_id}/{kind}/{id} and keep {kind}/{id} for org-owned resources
  • follow-up, not this PR: the OTLPDestinationRef description in kernel/kernel openapi.yaml still says project keys can select any org destination, which contradicts the project-scoped selection documented here

Terminology (per the "apps have runtime policies" feedback)

  • info/api-key-permissions.mdx:186,300 — "runtime-key requirements" / "shared runtime keys". consider pointing to the runtime policy, and moving the legacy shared-key caveat into the "Existing deployments" note
  • info/authentication.mdx:37 — consider "the app's runtime policy" as the link text instead of "the API key"

Structure / readability

  • info/api-keys.mdx:397 — the "Existing deployments" paragraph packs ~6 rules together. pull the gotcha into a callout: an app deployed with an unrestricted key and no runtime_policy can't be invoked by any scoped key
  • info/api-key-permissions.mdx:286 — the auth-connection row has 4 sentences and 7 actions in one cell. consider base requirements in the table plus a short "add when…" list
  • info/api-key-policy-examples.mdx:246-270 — the keys/audit example also bundles config_registry:read and its header caveat. consider moving it to its own example or dropping it
  • info/api-key-policy-examples.mdx:166-198 — consider leading with the split deployer/invoker pattern and showing the combined key as the shortcut
  • info/projects.mdx:109 — the per-permission bullet duplicates the reference table. consider linking to it instead

Duplication

  • the issuer-expiry rule appears at info/api-keys.mdx:171,189,193,548,631 and info/api-key-permissions.mdx:233,240,303. consider stating it once in #delegate-a-narrower-key and linking to it everywhere else
  • the "omit runtime_policy → only project-wide invocations:write" rule appears in api-keys.mdx, deploy.mdx, and api-key-policy-examples.mdx:197,201,243. consider stating it once per page at most

Nits

  • info/api-keys.mdx:631 — the new 400 row drops the source_ip rules (CIDR only, no host bits, no IPv4-in-IPv6). consider keeping them
  • info/api-key-policy-examples.mdx:51,109 — extensions:read / browser_pools:read aren't needed to attach an extension or acquire from a pool. consider dropping them or marking them optional, given "keep only the permissions you need"
  • info/api-key-permissions.mdx:94,173,183 — projects:create / tasks:create still say where to grant, which the other create rows dropped, and deployments:create describes the action combination. consider making these consistent
  • reference/cli/api-keys.mdx:50 — --query matches IDs and masked keys only by exact value, per the CLI help

@sjmiller609
sjmiller609 merged commit 22414dc into main Nov 25, 2026
3 checks passed
@sjmiller609
sjmiller609 deleted the hypeship/expand-scoped-key-docs branch November 25, 2026 17:45

This branch was successfully deployed

1 active deployment
staging — 5dcfaba9 Deployed Nov 25, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants